<template>
  <div>
      <!-- 计算属性 -->
      {{dateFormat}}季度
      <!-- 使用过滤器 -->
      <ul>
          <li v-for="(item,index) in list" :key="index">
              {{item.date|formatDate1}}
          </li>
      </ul>
      {{name|trimVal}}
  </div>
</template>

<script>
import {Format} from "@/utils/methods"
export default {
    // filters:{
    //     format1(value){
    //         return formatDate(value)
    //     }
    // },
    computed:{
      dateFormat() {
      return Format(this.date, "yyyy-MM-dd HH:mm:ss:S qq");
    }
    },
    data(){
        return{
            date:Date.now(),
            list:[
                {
                    date:Date.now()
                }
            ],
            name:' zhang '
        }
    },
    mounted(){
        let str="      a  b      "
        console.log(str.trim());//去除字符串首尾空格
    }
}
</script>

<style lang="scss" scoped>

</style>